/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package polybook.view;

import polybook.model.Network;
import polybook.model.NetworkTabLinked;

/**
 *
 * @author kazanova
 */
public class InfosDefaultView extends NamedJPanel {
    
    protected static final String title = "Reseau courant";
    
    protected Network currentNetwork;
    
    /**
     * Creates new form InfosDefaultView
     */
    public InfosDefaultView(Network network) {
        initComponents();
        this.currentNetwork = network;
        
        this.infosPersonCount.setText(Integer.toString(network.size()));
        this.infosLinkCount.setText(Integer.toString(network.getNbLink()));
        
        if(network instanceof NetworkTabLinked) {
            this.infosTypeNetwork.setText("Implémentation 1");
        } else {
            this.infosTypeNetwork.setText("Implémentation 2");
        }
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        titlePersonCount = new javax.swing.JLabel();
        titleLinkCount = new javax.swing.JLabel();
        infosPersonCount = new javax.swing.JLabel();
        infosLinkCount = new javax.swing.JLabel();
        titleTypeNetwork = new javax.swing.JLabel();
        infosTypeNetwork = new javax.swing.JLabel();

        setBorder(javax.swing.BorderFactory.createTitledBorder(getTitle()));
        setMinimumSize(new java.awt.Dimension(0, 100));
        setPreferredSize(new java.awt.Dimension(250, 100));

        titlePersonCount.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        titlePersonCount.setText("Nombre de personnes : ");

        titleLinkCount.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        titleLinkCount.setText("Nombre de liens d'amitié : ");

        infosPersonCount.setText("Non renseigné");

        infosLinkCount.setText("Non renseigné");

        titleTypeNetwork.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        titleTypeNetwork.setText("Type de réseau : ");

        infosTypeNetwork.setText("jLabel1");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(titleLinkCount, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(titlePersonCount, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(titleTypeNetwork, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(infosLinkCount, javax.swing.GroupLayout.DEFAULT_SIZE, 87, Short.MAX_VALUE)
                    .addComponent(infosTypeNetwork, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(infosPersonCount, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(titlePersonCount)
                    .addComponent(infosPersonCount))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(titleLinkCount)
                    .addComponent(infosLinkCount))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(titleTypeNetwork)
                    .addComponent(infosTypeNetwork))
                .addContainerGap(12, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel infosLinkCount;
    private javax.swing.JLabel infosPersonCount;
    private javax.swing.JLabel infosTypeNetwork;
    private javax.swing.JLabel titleLinkCount;
    private javax.swing.JLabel titlePersonCount;
    private javax.swing.JLabel titleTypeNetwork;
    // End of variables declaration//GEN-END:variables

    @Override
    public String getTitle() {
        return title;
    }
}
